package com.bweab.controll.userstbcontrol;

import com.bweab.service.api.UsersTbServiceInterface;
import com.bweab.service.impl.UsersTbServiceInterfaceImpl;
import com.bweab.util.JSONResult;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
@WebServlet("/adminAlterUserInfo")
public class AdminAlterUserInfo extends HttpServlet {

    //创建服务层
    UsersTbServiceInterface usersTbService =new UsersTbServiceInterfaceImpl();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取参数
        String userName = req.getParameter("userName");
        String userPassword = req.getParameter("userPassword");
        String userSex = req.getParameter("userSex");
        String userXh = req.getParameter("userXh");
        String userStatus = req.getParameter("userStatus");
        String userPhone = req.getParameter("userPhone");


        //传入参数
        JSONResult jsonResult = usersTbService.adminAlterUserInfo(userName, userPassword, userSex, userXh, userStatus, userPhone);

        //发送结果
        WebUtil.writeJson(resp,jsonResult);
    }
}
